project(grammar)
set(CMAKE_C_FLAGS_DEBUG "-DDEBUG")

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

SET(grammar_srcs
    Object.h
    Object.cpp
    JJTState.cpp
    JJTState.h
    PythonGrammar.cpp
    PythonGrammar.h
    GrammarErrorHandlers.h
    GrammarErrorHandlers.cpp
    Token.h
    Token.cc
    Node.h
    JavaCC.h
    CharStream.cpp
    CharStream.h
    TokenManager.h
    SimpleNode.cpp
    SimpleNode.h
    ParseException.h
    ParseException.cpp
    SpecialStr.h
    FastStringBuffer.h
    OString.h
    IVisitor.h
    Visitor.h
    CtxVisitor.h
    CtxVisitor.cpp
    TokensIterator.h
    RestoreCodeVisiter.h
    RestoreCodeVisiter.cpp
    MemoryPool.h
    ast/ComprehensionCollection.h
    ast/DefaultArg.h
    ast/FuncDefReturnAnn.h
    ast/IdentityNode.h
    ast/Decorators.h
    ast/JfpDef.h
    ast/ExtraArg.h
    ast/ExtraArgValue.h
    ast/aliasType.cpp
    ast/aliasType.h
    ast/argumentsType.cpp
    ast/argumentsType.h
    ast/Assert.cpp
    ast/Assert.h
    ast/Assign.cpp
    ast/Assign.h
    ast/Attribute.cpp
    ast/Attribute.h
    ast/AugAssign.cpp
    ast/AugAssign.h
    ast/BinOp.cpp
    ast/BinOp.h
    ast/BoolOp.cpp
    ast/BoolOp.h
    ast/boolopType.h
    ast/Break.cpp
    ast/Break.h
    ast/Call.cpp
    ast/Call.h
    ast/ClassDef.cpp
    ast/ClassDef.h
    ast/cmpopType.h
    ast/commentType.cpp
    ast/commentType.h
    ast/Compare.cpp
    ast/Compare.h
    ast/compContextType.h
    ast/Comprehension.cpp
    ast/Comprehension.h
    ast/comprehensionType.cpp
    ast/comprehensionType.h
    ast/Continue.cpp
    ast/Continue.h
    ast/decoratorsType.cpp
    ast/decoratorsType.h
    ast/Delete.cpp
    ast/Delete.h
    ast/DictComp.cpp
    ast/DictComp.h
    ast/Dict.cpp
    ast/Dict.h
    ast/Ellipsis.cpp
    ast/Ellipsis.h
    ast/excepthandlerType.cpp
    ast/excepthandlerType.h
    ast/exprContextType.h
    ast/Expr.cpp
    ast/Expression.cpp
    ast/Expression.h
    ast/Expr.h
    ast/exprType.cpp
    ast/exprType.h
    ast/ExtSlice.cpp
    ast/ExtSlice.h
    ast/For.cpp
    ast/For.h
    ast/FunctionDef.cpp
    ast/FunctionDef.h
    ast/GeneratorExp.cpp
    ast/GeneratorExp.h
    ast/Global.cpp
    ast/Global.h
    ast/If.cpp
    ast/IfExp.cpp
    ast/IfExp.h
    ast/If.h
    ast/Import.cpp
    ast/ImportFrom.cpp
    ast/ImportFrom.h
    ast/Import.h
    ast/Index.cpp
    ast/Index.h
    ast/Interactive.cpp
    ast/Interactive.h
    ast/intList.h
    ast/keywordType.cpp
    ast/keywordType.h
    ast/Lambda.cpp
    ast/Lambda.h
    ast/ListComp.cpp
    ast/ListComp.h
    ast/List.cpp
    ast/List.h
    ast/modType.cpp
    ast/modType.h
    ast/Module.cpp
    ast/Module.h
    ast/nameContextType.h
    ast/Name.cpp
    ast/Name.h
    ast/NameTok.cpp
    ast/NameTok.h
    ast/NameTokType.cpp
    ast/NameTokType.h
    ast/NonLocal.cpp
    ast/NonLocal.h
    ast/Num.cpp
    ast/Num.h
    ast/numTypeType.h
    ast/operatorType.h
    ast/Pass.cpp
    ast/Pass.h
    ast/Raise.cpp
    ast/Raise.h
    ast/Repr.cpp
    ast/Repr.h
    ast/Return.cpp
    ast/Return.h
    ast/SetComp.cpp
    ast/SetComp.h
    ast/Set.cpp
    ast/Set.h
    ast/Slice.cpp
    ast/Slice.h
    ast/sliceType.cpp
    ast/sliceType.h
    ast/Starred.cpp
    ast/Starred.h
    ast/stmtType.cpp
    ast/stmtType.h
    ast/Str.cpp
    ast/Str.h
    ast/StrJoin.cpp
    ast/StrJoin.h
    ast/strRepType.h
    ast/strTypeType.h
    ast/Subscript.cpp
    ast/Subscript.h
    ast/Suite.h
    ast/Suite.cpp
    ast/suiteType.cpp
    ast/suiteType.h
    ast/TryExcept.cpp
    ast/TryExcept.h
    ast/TryFinally.cpp
    ast/TryFinally.h
    ast/Tuple.cpp
    ast/Tuple.h
    ast/UnaryOp.cpp
    ast/UnaryOp.h
    ast/unaryopType.h
    ast/VisitorBase.h
    ast/While.cpp
    ast/While.h
    ast/With.cpp
    ast/With.h
    ast/WithItem.cpp
    ast/WithItem.h
    ast/WithItemType.cpp
    ast/WithItemType.h
    ast/Yield.cpp
    ast/Yield.h
)

add_subdirectory(python3)

add_library(grammar ${grammar_srcs})
#TARGET_LINK_LIBRARIES(grammar python3)

